package copyfile;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class GetFileList {
	public static void main(String[] args) {
		long start = System.currentTimeMillis();
		getAllFile("D:/eclipse");
		long end = System.currentTimeMillis();
		System.out.println(end -start);
	}

	static long count = 0;
	public static void getAllFile(String path) {
		File file = new File(path);
		if (!file.exists()) {
			return  ;
		}
		if (file.isDirectory()) {
			count++;
			//System.out.println(count+"文件夹： "+path);
			File [] tempList = file.listFiles();
			for (int i = 0; i < tempList.length; i++) {
				getAllFile(tempList[i].getAbsolutePath());
			}
		}
		if (file.isFile()) {
			count++;
			//System.out.println(count+"文件： "+path);
		}
	}
	 
}
